<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<link href="./css/modern.css" rel="stylesheet">
<link href="./css/style-student.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>

<script>
function ViewValidation()
{
	var radios = document.getElementsByName('courseNumber');
	for(var i =0; i< radios.length; i++)
	{
		if(radios[i].checked){
			return true;
		}
	}
	
	alert("Please Select a Course!");
	return false;
}
</script>

<body>
	<%
		String firstname = (String) request.getAttribute("firstname");
		String lastname = (String) request.getAttribute("lastname");
		String studentID = (String) request.getAttribute("studentID");
	%>
	<div id="container">
		<div id="header">
			<br>
			<h1 id="main-title">
				<b><font color="000000"> EECE Student Group Assessments</b></font>
			</h1>
			<h2>
				Welcome
				<%=firstname%>
				<%=lastname%>
				! Please select a class! <a href="index.html">
					<p align="right">
						<font size="5">Logout</font>
					</p>
				</a>
			</h2>
		</div>
		<div id="body">
			<br> 
			<div id="innerBody" class="page-region-content tiles">
				<h1>Student Portal</h1>
				<div class="tile-group" align="left">
					<form id="bluebear" action="StudentViewGradesServlet" method="get">
						<table cellspacing="0" cellpadding="0" border="0" width="250"
							class="striped" border=0>
							<c:forEach items="${CourseInfo}" var="Info">
								<tr>
									<td><label class="radio" onclick=""> <input
											type="radio" name="courseNumber"
											value="${Info.courseNumber}/${Info.sectionNumber}" />
									</label></td>
									<td>
										<input type="hidden" name="firstname" value=<%=firstname%>> 
										<input type="hidden" name="lastname" value=<%=lastname%>> 
										<input type="hidden" name="studentID" value=<%=studentID%>>
										<div class="tile quadro bg-color-blue">
											<div class="tile-content">
												<h2 align="left">
													<font size="5"> <c:out value="${Info.courseNumber}" />
														- Section - <c:out value="${Info.sectionNumber}" /> - <c:out
															value="${Info.courseName}" /> - <c:out
															value="${Info.termYear}" />W
													</font> 
													<input type="hidden" name="courseNumber" value="${Info.courseNumber}"> 
													<input type="hidden" name="sectionNumber" value="${Info.sectionNumber}">
												</h2>
												<br>
												<p align="left">
													<font size="4"> Section Instructor: <c:out
															value="${Info.instructor}" /></font>
												</p>
											</div>
										</div>
									</td>
								</tr>
							</c:forEach>
						</table>
						<div align="left">
						<input type="submit" name = "button" value="View Grades" onclick="return ViewValidation()"/>
						<input type="submit" name = "button" value="View Group" onclick ="return ViewValidation()"/>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
	</div>
</body>
</html>